package Java.BlackHorse.IO.CharStream;

import java.io.FileReader;
import java.io.IOException;

public class IODemo2 {
    public static void main(String[] args) throws IOException {
        char[] arr = new char[2];
        FileReader fr = new FileReader("IO\\CharStream\\c.txt");
        int len;
        while((len=fr.read(arr)) != -1){//read的有参方法会直接把数据转换成char类型
            System.out.print(new String(arr,0,len));
        }
        fr.close();
    }
}
